//
//  EffectObject.m
//  图片故事
//
//  Created by 大帅逼 on 16/3/4.
//  Copyright © 2016年 helloApp. All rights reserved.
//

#import "EffectObject.h"
#import "FWApplyFilter.h"
#import "FilterModel.h"

@implementation EffectObject

+(UIImage *)effectFilterImageWithIndex:(NSInteger)index oldImage:(UIImage *)oldImage {
    UIImage *newImage;
    
    // 根据点击的序列来执行对应的方法
    switch (index) {
        case 0:
            
            newImage = [FWApplyFilter applyMissetikateFilter:oldImage];
            break;
        case 1:
            
            newImage = [FWApplyFilter applySoftEleganceFilter:oldImage];
            break;
        case 2:
            
            newImage = [FWApplyFilter applyNashvilleFilter:oldImage];
            break;
        case 3:
            
            newImage = [FWApplyFilter applyRiseFilter:oldImage];
            break;
        case 4:
            
            newImage = [FWApplyFilter applyHudsonFilter:oldImage];
            break;
        case 5:
            
            newImage = [FWApplyFilter applyXproIIFilter:oldImage];
            break;
        case 6:
            
            newImage = [FWApplyFilter apply1977Filter:oldImage];
            break;
        case 7:
            
            newImage = [FWApplyFilter applyValenciaFilter:oldImage];
            break;
        case 8:
            
            newImage = [FWApplyFilter applyWaldenFilter:oldImage];
            break;
        case 9:
            
            newImage = [FWApplyFilter applyLomofiFilter:oldImage];
            break;
        case 10:
            
            newImage = [FWApplyFilter applyInkwellFilter:oldImage];
            break;
        case 11:
            
            newImage = [FWApplyFilter applySierraFilter:oldImage];
            break;
        case 12:
            
            newImage = [FWApplyFilter applyEarlybirdFilter:oldImage];
            break;
        case 13:
            
            newImage = [FWApplyFilter applySutroFilter:oldImage];
            break;
        case 14:
            
            newImage = [FWApplyFilter applyToasterFilter:oldImage];
            break;
        case 15:
            
            newImage = [FWApplyFilter applyBrannanFilter:oldImage];
            break;
        case 16:
            
            newImage = [FWApplyFilter applyHefeFilter:oldImage];
            break;
        case 17:
            
            newImage = [FWApplyFilter applyAmatorkaFilter:oldImage];
            break;
        case 18:
            
            newImage = [FWApplyFilter applyAmaroFilter:oldImage];
            break;
            
        default:
            break;
    }
    
    return newImage;
}

+ (NSArray *)readEffectFilterArray {

    NSArray *effectTitleArray = [NSArray arrayWithObjects:@"HDR",@"流年",@"唯美",@"美肤",@"云端",@"淡雅",@"粉红",@"复古",@"候鸟",@"Lomo",@"1900",@"古铜色",@"哥特",@"移轴",@"Toaster",@"Brannan",@"Hefe",@"优格",@"暗沉", nil];
    
    NSArray *effectImageArray = [[NSArray alloc] initWithObjects:@"effect_01",@"effect_02",@"effect_03",@"effect_04",@"effect_05",@"effect_06",@"effect_07",@"effect_08",@"effect_09",@"effect_10",@"effect_11",@"effect_12",@"effect_13",@"effect_14",@"effect_15",@"effect_16",@"effect_17",@"effect_18",@"effect_19", nil];
    
    NSMutableArray *effectFilterArray = [[NSMutableArray alloc] init];
    
    for (int i = 0; i < effectTitleArray.count; i++) {
        
        FilterModel *object = [[FilterModel alloc] init];
        
        [object setFilterImage:[effectImageArray objectAtIndex:i]];
        
        [object setFilterTitle:[effectTitleArray objectAtIndex:i]];
        
        [effectFilterArray addObject:object];
    }
    
    return [effectFilterArray copy];
}

@end
